import greenfoot.*;  

public class BackButton extends Actor {
    public BackButton() {
        setImage(new GreenfootImage("返回", 30, Color.BLACK, new Color(0,0,0,0)));
    }

    public void act() {
        if (Greenfoot.mouseClicked(this)) {
            Greenfoot.setWorld(new MenuWorld()); // 返回主菜单
        }
    }
}
